package com.echo.controller;

import com.echo.common.cache.CacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author echo
 * @Description
 * @Date 2024/4/16.
 * @Version 1.0
 */
@RestController
public class TestController {

    @Autowired
    private CacheService cache;

    @RequestMapping("/set/{key}")
    public String set(@PathVariable(value = "key") String key){
        cache.set(key);
        return  "sucess";
    }

    @RequestMapping("/get/{key}")
    public String get(@PathVariable(value = "key") String key){
        return (String) cache.get(key);
    }
}
